package com.dtstack.rocketmq.listener;

import com.google.common.eventbus.Subscribe;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * GrainCostEventListener
 *
 * <p>
 *     创建监听器：创建一个监听器类来处理事件。使用@Subscribe注解来标记事件处理方法。
 * </p>
 *
 * @author chuanbai
 * @date 2024/11/11
 */
@Component
public class GrainCostEventListener {

    private static final Logger logger = LoggerFactory.getLogger(GrainCostEventListener.class);

    @Subscribe
    public String listen(GrainCostEvent event) {
        logger.info("Received event with message: " + event.getMessage());
        return "ok";
    }
}